package com.acme.bankapp.domain.bank;

public class SavingAccount extends AbstractAccount {

	private static final long serialVersionUID = 2808396931282203187L;

	public SavingAccount(double amount) throws NegativeArgumentValueException {
		super(amount);
	}

	@Override
	public void withdraw(final double amount) throws NotEnoughFundsException {
		if (amount > balance) {
			throw new NotEnoughFundsException(amount);
		}
		setBalance(balance - amount);
	}

	@Override
	public double maximumAmountTowothdraw() {
		return getBalance();
	}

}
